package com.eascs.ticket.ticket.form;

import java.util.Date;

import javax.validation.constraints.Max;

import com.eascs.app.dao.sql.SqlBuilderExpression;
import com.eascs.app.dao.sql.SqlExpression;
import com.eascs.app.dao.sql.SqlGroupExpression;
import com.eascs.app.dao.sql.SqlOrderExpression;
import com.eascs.app.dao.sql.ValueFilterField;
import com.eascs.app.dao.sql.filter.AddOneDayValueFilter;

public class TicketSearchForm {

	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.operator")
	private String operators;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.creator")
	private String creators;
	@SqlBuilderExpression(value = SqlExpression.NOT_IN, columnName = "t.status")
	private String statusNotIns;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.status")
	private String statusIns;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.version_ticket_id")
	private String versions;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.parent_ticket_id")
	private String parents;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.ticket_type_code")
	private String ticketTypeCodes;
	@SqlBuilderExpression(value = SqlExpression.NOT_IN, columnName = "t.ticket_type_code")
	private String ticketTypeCodeNotIns;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.project_id")
	private String projectIds;
	@SqlBuilderExpression(value = SqlExpression.NOT_IN, columnName = "t.project_id")
	private String projectIdsNotIns;
	@SqlBuilderExpression(value = SqlExpression.LIKE, columnName = "CONCAT(t.id,t.title)")
	private String keyWord;
	@SqlBuilderExpression(value = SqlExpression.EQUAL_OR_GREATER, columnName = "t.due_date")
	public Date dueDateStart;
	@SqlBuilderExpression(value = SqlExpression.LESSER, columnName = "t.due_date")
	@ValueFilterField(valueFilters = { AddOneDayValueFilter.class })
	public Date dueDateEnd;
	@SqlBuilderExpression(value = SqlExpression.IN, columnName = "t.id")
	private String ticketIds;

	@SqlBuilderExpression(value = SqlExpression.EQUAL_OR_GREATER, columnName = "IFNULL(v.publish_prod_time,t.publish_prod_time)")
	private Date publishDateStart;

	@SqlBuilderExpression(value = SqlExpression.LESSER, columnName = "IFNULL(v.publish_prod_time,t.publish_prod_time)")
	@ValueFilterField(valueFilters = { AddOneDayValueFilter.class })
	private Date publishDateEnd;

	@SqlOrderExpression
	private String sqlOrder;
	@SqlGroupExpression
	private String sqlGroup;

	private String render;
	private int pageIndex;
	@Max(value = 200)
	private int pageSize = 10;

	private String orderBy;
	private String groupBy;

	private String action;

	public String getOperators() {
		return operators;
	}

	public void setOperators(String operators) {
		this.operators = operators;
	}

	public String getRender() {
		return render;
	}

	public void setRender(String render) {
		this.render = render;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public String getCreators() {
		return creators;
	}

	public void setCreators(String creators) {
		this.creators = creators;
	}

	public String getStatusNotIns() {
		return statusNotIns;
	}

	public void setStatusNotIns(String statusNotIns) {
		this.statusNotIns = statusNotIns;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public String getVersions() {
		return versions;
	}

	public void setVersions(String versions) {
		this.versions = versions;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public String getParents() {
		return parents;
	}

	public void setParents(String parents) {
		this.parents = parents;
	}

	public String getTicketTypeCodes() {
		return ticketTypeCodes;
	}

	public void setTicketTypeCodes(String ticketTypeCodes) {
		this.ticketTypeCodes = ticketTypeCodes;
	}

	public String getProjectIds() {
		return projectIds;
	}

	public void setProjectIds(String projectIds) {
		this.projectIds = projectIds;
	}

	public String getGroupBy() {
		return groupBy;
	}

	public void setGroupBy(String groupBy) {
		this.groupBy = groupBy;
	}

	public String getSqlOrder() {
		return sqlOrder;
	}

	public void setSqlOrder(String sqlOrder) {
		this.sqlOrder = sqlOrder;
	}

	public String getSqlGroup() {
		return sqlGroup;
	}

	public void setSqlGroup(String sqlGroup) {
		this.sqlGroup = sqlGroup;
	}

	public String getTicketTypeCodeNotIns() {
		return ticketTypeCodeNotIns;
	}

	public void setTicketTypeCodeNotIns(String ticketTypeCodeNotIns) {
		this.ticketTypeCodeNotIns = ticketTypeCodeNotIns;
	}

	public String getProjectIdsNotIns() {
		return projectIdsNotIns;
	}

	public void setProjectIdsNotIns(String projectIdsNotIns) {
		this.projectIdsNotIns = projectIdsNotIns;
	}

	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

	public String getStatusIns() {
		return statusIns;
	}

	public void setStatusIns(String statusIns) {
		this.statusIns = statusIns;
	}

	public Date getDueDateStart() {
		return dueDateStart;
	}

	public void setDueDateStart(Date dueDateStart) {
		this.dueDateStart = dueDateStart;
	}

	public Date getDueDateEnd() {
		return dueDateEnd;
	}

	public void setDueDateEnd(Date dueDateEnd) {
		this.dueDateEnd = dueDateEnd;
	}

	public String getTicketIds() {
		return ticketIds;
	}

	public void setTicketIds(String ticketIds) {
		this.ticketIds = ticketIds;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public Date getPublishDateStart() {
		return publishDateStart;
	}

	public void setPublishDateStart(Date publishDateStart) {
		this.publishDateStart = publishDateStart;
	}

	public Date getPublishDateEnd() {
		return publishDateEnd;
	}

	public void setPublishDateEnd(Date publishDateEnd) {
		this.publishDateEnd = publishDateEnd;
	}

}
